package site.luojie.platform.gateway.server;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import site.luojie.common.vo.ResultVo;

/**
 * @author jie.luo
 * @since 2020/9/18
 */
@FeignClient(
        name = "user",
        fallback = UserFeignService.UserFeignServiceFallbackImpl.class,
        path = "/user"
)
public interface UserFeignService {
    /**
     * 检测用户是否已注册
     */
    @GetMapping("/check/token")
    ResultVo<Boolean> checkToken(@RequestParam("token") String token);

    class UserFeignServiceFallbackImpl implements UserFeignService {

        @Override
        public ResultVo<Boolean> checkToken(String token) {
            return ResultVo.customData("000", "用户服务GG啦");
        }
    }
}
